import http from '../utils/request.js'

//  搜索景区
// query scenicName 搜索内容  pageNum 页码数   pageSize 页码数据大小
export const searchscenic = (params) => {
	return http.get('/app/scenic/findScenicBySearch', {params})
}

// 搜索景点数据
//  query scenicId 景区id 
export const getscenicdetails = (params) => {
	return http.get('/app/scenic/findScenicById', { params})
}

// 获取景点评论
// query scenicId 景区id pageNum 页码数   pageSize 页码数据大小
export const getsceniccomments = (params) => {
	return http.get('/app/comment/findAllComment', {params})
}

// 删除景点评论
// query commentId 评论的Id
export const deletesceniccomments = (params) => {
	return http.delete(`/app/comment/delComment`)
}

// 发布景点评论
// body   userId 用户Id scenicId 景区id content 评论内容
export const sendscenic = (params) => {
	return http.post('/app/comment/addComment', params)
}

// 收藏景区
// body scenicId 景点id userId 用户id
export const collectsaddcenic = (params) => {
	return http.post('/app/collection/addCollection',  params)
}
// 判断是否收藏景区
export const iscolection = (params) => {
	return http.get('/app/collection/isCollection', { params})
}

// 删除收藏景区
// query scenicId 景点id userId 用户id
export const collectdeletescenic = (params) => {
	return http.delete(`/app/collection/delCollection?userId=${params.userId}&scenicId=${params.scenicId}`)
}

// 获取收藏景区列表
// query userId 用户id pageNum 页码数   pageSize 页码数据大小
export const collectgetscenic = (params) => {
	return http.get('/app/collection/findAllCollection', {params})
}

// 获取热度景区列表
// query pageNum 页码数   pageSize 页码数据大小
export const gethostscene = (params) => {
	return http.get('/app/scenic/findScenicByReading', { params })
}

// 获取最近景区列表
// query  mylatitude 用户的纬度 mylongitude 	用户的经度  userId 用户Id
export const getclosescene = (params) => {
	return http.get('/app/scenic/findScenicByDistance', { params })
}

// 获取推荐景区
export const getscenerecommend = (params) => {
	return http.get('/app/scenic/findNearScenic', { params})
}
